package com.changgou.goods.dao;

import com.changgou.goods.pojo.Category;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

@Component
public interface CategoryMapper extends Mapper<Category> {
    @Select("SELECT * FROM `tb_category` WHERE parent_id = 0")
    public List<Category> firstFindCategory();

    @Select("SELECT * FROM `tb_category` WHERE parent_id = #{id}")
    public List<Category> findParentCategoryById( Integer id);

}
